We need to keep track of how many times the left and down arrow keys are pressed.

  • Click on the Python tab and click on . Drag two Integer Variable commands into your program.

A variable lets us store information. The variable has a name and a value. Like this: name = value.

  • Change the name of one variable to left_count and the other to down_count.
  • Change both of the values to 0.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)